var express = require('express');
var router = express.Router();

const {
  findBranchByPage, 
  findAll,
  addBranch, 
  findOneById, 
  updateOneById, 
  deleteOneById,
} = require("../controller/branch");
const { authFilter } = require("../middlewares/auth");

class BranchRouter {
  static initRouter() {
    router.get('/', authFilter, findBranchByPage);
    router.get('/findAll', authFilter, findAll);
    router.post('/0', authFilter, addBranch);
    router.get('/:id', authFilter, findOneById);
    router.put('/:id', authFilter, updateOneById);
    router.delete('/:id', authFilter, deleteOneById);
    return router;
  }
}
module.exports = BranchRouter.initRouter();